package com.ds.infrastructure.audit.consumer.controller;

import com.ds.infrastructure.audit.consumer.service.ConsumerService;
import com.ds.infrastructure.audit.common.entity.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 作用：
 *
 * @author WeiShaoying
 * @date 2021/4/21
 */
@RestController
@RequestMapping("/consumer/test")
@Slf4j
public class ConsumerController {

    @Autowired
    private ConsumerService consumerService;

    @GetMapping("/queryTodayWeather")
    public Result<String> queryTodayWeather() {
        return Result.success(consumerService.queryTodayWeather());
    }

    @GetMapping("/queryWeekWeather")
    public Result<String> queryWeekWeather() {
        return Result.success(consumerService.queryWeekWeather());
    }

    @GetMapping("/queryRoadState")
    public Result<String> queryRoadState() {
        return Result.success(consumerService.queryRoadState());
    }

    @GetMapping("/queryBoth")
    public Result<String> queryBoth() {
        return Result.success(consumerService.queryBoth());
    }

}
